<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>BillsManage</title>
    <link rel="stylesheet" href="/lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="/css/bill.css">
    <!-- <link rel="stylesheet" href="/css/index.css"> -->
    <script src="/lib/requirejs/require.js" data-main="/js/bill"></script>
</head>

<body>
    <nav class="navbar navbar-default header"></nav>
    <div class="fixleft"></div>

    <div class="right">
        <div class="alert alert-success clearfix" role="alert">
            <form class="form-inline pull-left search">
                <div class="form-group findbyusername">
                    <label for="exampleInputName2">商品名称: </label>
                    <input type="text" class="form-control" id="exampleInputName2" placeholder="请输入商品名称" name="proname">
                </div>
                <button type="submit" class="btn btn-success btn-find">
                    <img src="/images/search.png" alt="">
                    查询
                </button>
            </form>
            <button type="submit" class="btn btn-primary btn-adduesr" data-toggle="modal" data-target="#addmyModal">
                <img src="/images/tianjia.png" alt="">
                添加订单
            </button>
        </div>

        <table class="table table-bordered">
            <thead>
                <tr>
                    <td>账单编号</td>
                    <td>商品名称</td>
                    <td>商品单位</td>
                    <td>供应商</td>
                    <td>数量</td>
                    <td>账单金额</td>
                    <td>是否付款</td>
                    <td>创建时间</td>
                    <td>操作</td>
                </tr>
            </thead>
            <tbody class="bills-body">

            </tbody>


            <script type="text/html" id="bill_template">
                {{each data bill}}
                <tr>
                    <td class="_id">{{bill._id}}</td>
                    <td class="proname">{{bill.proname}}</td>
                    <td class="prounit">{{bill.prounit}}</td>
                    
                    <td class="supplier">{{bill.supplier}}</td>
                    <td class="number">{{bill.number}}</td>
                    <td class="money">{{bill.money}}</td>
                    <td class="flag">{{bill.flag}}</td>
                    <td class="datatime">{{bill.datatime}}</td>
                    <td>
                        <a href="javascript:void(0);" class="read aa">
                            <img src="/images/read.png" alt="">
                        </a>
                        <a href="javascript:void(0);" class="update aa">
                            <img src="/images/xiugai.png" alt=""  data-toggle="modal" data-target="#upmyModal" class="update">
                        </a>
                        <a href="javascript:void(0);" class="del aa">
                            <img src="/images/schu.png" alt="" >
                        </a>
                    </td>
                </tr>
                {{/each}}
            </script>
            <script type="text/html" id="bills_template">
                {{each list bill}}
                <tr>
                    <td class="_id">{{bill._id}}</td>
                    <td class="proname">{{bill.proname}}</td>
                    <td class="prounit">{{bill.prounit}}</td>
                    
                    <td class="supplier">{{bill.supplier}}</td>
                    <td class="number">{{bill.number}}</td>
                    <td class="money">{{bill.money}}</td>
                    <td class="flag">{{bill.flag}}</td>
                    <td class="datatime">{{bill.datatime}}</td>
                    <td>
                            <a href="javascript:void(0);" class="read aa">
                                    <img src="/images/read.png" alt="">
                                </a>
                                <a href="javascript:void(0);" class="update aa">
                                    <img src="/images/xiugai.png" alt="" data-toggle="modal" data-target="#upmyModal" class="update">
                                </a>
                                <a href="javascript:void(0);" class="del aa">
                                    <img src="/images/schu.png" alt="" >
                                </a>
                    </td>
                </tr>
                {{/each}}
            </script>
        </table>



        <nav aria-label="Page navigation">
            <ul class="pagination">
                <li>
                    <a href="#" aria-label="Previous" class="prev">
                        <span aria-hidden="true">&laquo;</span>
                    </a>
                </li>
                <li class="active"><a href="#" class="page">1</a></li>
                <li><a href="#" class="page">2</a></li>
                <li><a href="#" class="page">3</a></li>
                <li><a href="#" class="page">4</a></li>
                <li><a href="#" class="page">5</a></li>
                <li>
                    <a href="#" aria-label="Next" class="next">
                        <span aria-hidden="true">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    </div>

    <!-- 添加修改模态框 -->
    <div class="modal fade" id="addmyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body">
                    <form class="form-bill">
                        <div class="form-group">
                            <label for="proname">商品名称</label>
                            <input type="text" class="form-control" id="proname" name="proname">
                        </div>
                        <div class="form-group">
                            <label for="prounit">商品单位</label>
                            <input type="text" class="form-control" id="prounit" name="prounit">
                        </div>
                        <div class="form-group">
                            <label for="number">商品数量</label>
                            <input type="text" class="form-control" id="number" name="number">
                        </div>
                        <div class="form-group">
                            <label for="money">总金额</label>
                            <input type="text" class="form-control" id="money" class="money" name="money">
                        </div>
                        <div class="form-group">
                            <label for="supplier">供应商</label>
                            <select id="supplier" class="form-control" name="supplier">
                                <option value="1">1</option>
                                <option value="2">2</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="flag">是否付款</label>
                            <label class="radio-inline">
                                <input type="radio" name="flag" id="inlineRadio1" value="未付款"> 未付款
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="flag" id="inlineRadio2" value="已付款"> 已付款
                            </label>
                        </div>
                        <div class="form-group">
                            <label for="datatime">时间</label>
                            <input type="text" class="form-control" id="datatime" name="datatime">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    <button type="button" class="btn btn-primary btn-add-bill" data-dismiss="modal">添加</button>
                </div>
            </div>
        </div>
    </div>


    <div class="modal fade" id="upmyModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                </div>
                <div class="modal-body">
                    <form class="form-updatebill">
                        <div class="form-group hidden">
                            <label for="upid">id</label>
                            <input type="text" class="form-control" id="upid" name="upid">
                        </div>
                        <div class="form-group">
                            <label for="upproname">商品名称</label>
                            <input type="text" class="form-control" id="upproname" name="upproname">
                        </div>
                        <div class="form-group">
                            <label for="upprounit">商品单位</label>
                            <input type="text" class="form-control" id="upprounit" name="upprounit">
                        </div>
                        <div class="form-group">
                            <label for="upnumber">商品数量</label>
                            <input type="text" class="form-control" id="upnumber" name="upnumber">
                        </div>
                        <div class="form-group">
                            <label for="upmoney">总金额</label>
                            <input type="text" class="form-control" id="upmoney" class="upmoney" name="upmoney">
                        </div>
                        <div class="form-group">
                            <label for="upsupplier">供应商</label>
                            <select id="supplier" class="form-control" name="upsupplier">
                                <option value="1">1</option>
                                <option value="2">2</option>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="flag">是否付款</label>
                            <label class="radio-inline">
                                <input type="radio" name="flag" id="inlineRadio1" value="未付款"> 未付款
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="flag" id="inlineRadio2" value="已付款"> 已付款
                            </label>
                        </div>
                        <div class="form-group">
                            <label for="updatatime">时间</label>
                            <input type="text" class="form-control" id="updatatime" name="updatatime">
                        </div>
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">返回</button>
                    <button type="button" class="btn btn-primary btn-up-bill" data-dismiss="modal">修改</button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>